import App from './App'


import store from './store/index.js'
Vue.prototype.$store = store


// 挂在助手函数库
import $U from './common/util.js';
Vue.prototype.$U = $U

// 权限判断有无登录 没有登录跳转到登录页面
Vue.prototype.checkAuth = (callback) => {
	if (!store.state.isLogin) {
		uni.showToast({
			title: "请先登录",
			icon: "none"
		})
		setTimeout(() => {
			return uni.navigateTo({
				url: "/pages/login/login",

			});
		}, 100)
	}
	callback()
}
// 权限验证跳转 就是要跳转的时候使用 比如发布
Vue.prototype.navigateTo = (options) => {
	if (!store.state.isLogin) {
		uni.showToast({
			title: "请先登录",
			icon: "none"
		})
		return uni.navigateTo({
			url: "/pages/login/login",
		});
	}
	uni.navigateTo(options)
}










// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App,
	store
})

app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app,
		store
	}
}
// #endif